<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python documentation Index' />
<link rel="first" href="lib.html" title='Python library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node704.html" />
<link rel="prev" href="module-Tix.html" />
<link rel="parent" href="module-Tix.html" />
<link rel="next" href="node704.html" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='aesop' content='information' />
<title>20.2.1 Using Tix</title>
</head>
<body>
<div class="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="20.2 tix  "
  href="module-Tix.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="20.2 tix  "
  href="module-Tix.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="20.2.2 tix Widgets"
  href="node704.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-Tix.html">20.2 Tix  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-Tix.html">20.2 Tix  </a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node704.html">20.2.2 Tix Widgets</a>
</div>
<hr /></div>
</div>
<!--End of Navigation Panel-->

<h2><a name="SECTION0022210000000000000000">
20.2.1 Using Tix</a>
</h2>

<p>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
  <td><nobr><b><span class="typelabel">class</span>&nbsp;<tt id='l2h-4709' xml:id='l2h-4709' class="class">Tix</tt></b>(</nobr></td>
  <td><var>screenName</var><big>[</big><var>, baseName</var><big>[</big><var>, className</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt>
<dd>
    Toplevel widget of Tix which represents mostly the main window
    of an application. It has an associated Tcl interpreter.

<p>
Classes in the <tt class="module"><a href="module-Tix.html">Tix</a></tt> module subclasses the classes in the
<tt class="module"><a href="module-Tkinter.html">Tkinter</a></tt> module. The former imports the latter, so to use
<tt class="module"><a href="module-Tix.html">Tix</a></tt> with Tkinter, all you need to do is to import one
module. In general, you can just import <tt class="module"><a href="module-Tix.html">Tix</a></tt>, and replace
the toplevel call to <tt class="class">Tkinter.Tk</tt> with <tt class="class">Tix.Tk</tt>:
<div class="verbatim"><pre>
import Tix
from Tkconstants import *
root = Tix.Tk()
</pre></div>
</dl>

<p>
To use <tt class="module"><a href="module-Tix.html">Tix</a></tt>, you must have the <tt class="module"><a href="module-Tix.html">Tix</a></tt> widgets installed,
usually alongside your installation of the Tk widgets.
To test your installation, try the following:
<div class="verbatim"><pre>
import Tix
root = Tix.Tk()
root.tk.eval('package require Tix')
</pre></div>

<p>
If this fails, you have a Tk installation problem which must be
resolved before proceeding. Use the environment variable <a class="envvar" id='l2h-4710' xml:id='l2h-4710'>TIX_LIBRARY</a>
to point to the installed <tt class="module"><a href="module-Tix.html">Tix</a></tt> library directory, and
make sure you have the dynamic object library (<span class="file">tix8183.dll</span> or
<span class="file">libtix8183.so</span>) in  the same directory that contains your Tk
dynamic object library (<span class="file">tk8183.dll</span> or <span class="file">libtk8183.so</span>). The
directory with the dynamic object library should also have a file
called <span class="file">pkgIndex.tcl</span> (case sensitive), which contains the line:

<p>
<div class="verbatim"><pre>
package ifneeded Tix 8.1 [list load "[file join $dir tix8183.dll]" Tix]
</pre></div> 
<p>

<div class="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="20.2 tix  "
  href="module-Tix.html"><img src='../icons/previous.png'
  border='0' height='32'  alt='Previous Page' width='32' /></a></td>
<td class='online-navigation'><a rel="parent" title="20.2 tix  "
  href="module-Tix.html"><img src='../icons/up.png'
  border='0' height='32'  alt='Up one Level' width='32' /></a></td>
<td class='online-navigation'><a rel="next" title="20.2.2 tix Widgets"
  href="node704.html"><img src='../icons/next.png'
  border='0' height='32'  alt='Next Page' width='32' /></a></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
  href="contents.html"><img src='../icons/contents.png'
  border='0' height='32'  alt='Contents' width='32' /></a></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
  border='0' height='32'  alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
  href="genindex.html"><img src='../icons/index.png'
  border='0' height='32'  alt='Index' width='32' /></a></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-Tix.html">20.2 Tix  </a>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-Tix.html">20.2 Tix  </a>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node704.html">20.2.2 Tix Widgets</a>
</div>
</div>
<hr />
<span class="release-info">Release 2.5.1, documentation updated on 18th April, 2007.</span>
</div>
<!--End of Navigation Panel-->
<address>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</address>
</body>
</html>
